<template>
	<view class="core-item" @click="maintainPartItemClick">
		<image class="core-item__pic" :src="Image" />
		<image v-if="IsShowDeleteBtn" src="../../static/img/icon-close-black.png" class="core-item__del" @click="onDeleteItem" />
		<view class="core-item__body">
			<view class="core-item__head">
				<text class="core-item__name">{{maintenanceItem.PartsNum}}</text>
				<view class="ag-status-tag">
					<text>{{maintenanceItem.AppBrief}}</text>
				</view>
			</view>
			<view class="core-item__desc">
				{{maintenanceItem.PartsName}}
			</view>
			<view class="core-item__tags">
				<view class="ag-status-tag">
					<text>零售价：{{maintenanceItem.Price}}</text>
				</view>
				<view class="ag-status-tag">
					<text>网点库存：{{maintenanceItem.SiteStock}}</text>
				</view>
				<!-- <view class="ag-status-tag">
					<text>保养周期：{{maintenanceItem.MaintainPeriod}}</text>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import AGInput from '@/components/AGInput';
	export default {
		components: {
			AGInput
		},
		props:{
			maintenanceItem:{
				type:Object,
				default(){
					return{}
				}
			},
			IsShowDeleteBtn:{
				type:Boolean,
				default(){
					return false
				}
			},
			Image:{
				type:String,
				default(){
					return""
				}
			},
		},
		onLoad(e){
		},
		data(){
			return{
				
			}
		},
		methods:{
			maintainPartItemClick(e){
				if(!this.IsShowDeleteBtn)
					this.$emit('maintainPartItemClick',this.maintenanceItem);
			},
			getImage(image) {
				return (image != null && image != 'null' && image != '') ?
					"data:image/jpeg;base64," + image : "";
			},
			onDeleteItem(e){
				this.$emit('onDeleteItem',this.maintenanceItem);
			}
		}
	}
</script>

<style lang="scss">
	@import '../MaintainPartItem/index.scss'
</style>
